﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using t_205_verk_hopur_12.Models;

namespace t_205_verk_hopur_12.Tests.Fakes
{
    class FakeCategoryRepository : ICategoryRepository
    {

        
        private List<Category> catList;

        public FakeCategoryRepository(List<Category> categories)
        {
            catList = categories;
        }

        public IQueryable<Category> GetAllCategories()
        {
            return (from y in catList
                    select y).AsQueryable();
        }

        public Category GetSingleCategory(int id)
        {
            return catList.SingleOrDefault(c => c.ID == id);
        }
    }
}
